<template>
  <div class="container">
    <headerNav title="我的收藏"></headerNav>
    <div v-if="mycollections.length>0">
      <post v-for="(post,index) in mycollections" :key="index" :item="post" />
    </div>
    <div class="no-content" v-else>
      暂无收藏文章~
    </div>
    
  </div>
</template>

<script>
import headerNav from "../components/headerNav";
import post from '../components/post';

export default {
  components: { headerNav,post },
  data() {
    return {
      mycollections: []
    };
  },
  async mounted() {
    const res = await this.$api.getMyLike();
    this.mycollections = res.data.data;
  }
};
</script>

<style lang="less" scoped>
.no-content{
  width: 100vw;
  height: 80vh;
  display: flex;
  justify-content: center;
  align-items: center;
}
</style>